package novel.common.enums;

/**
 * Created by 888 on 2017/9/20.
 */
public enum TagType {
  gongju("工具", 1),
  gouwu("购物", 2),
  jiaotong("交通", 3),
  shenghuo("生活", 4),
  yule("娱乐", 5),
  xinwen("新闻", 6),
  jiaoyu("教育", 7),
  yiliao("医疗", 8),
  meitu("美图", 9),
  luxing("旅行", 10),
  yuedu("阅读", 11),
  shipin("视频", 12),
  meishi("美食", 13),
  meizhuang("美妆", 14),
  fangchan("房地产", 15),
  qiche("汽车", 16),
  zimeiti("自媒体", 17),
  shequ("社区", 18),
  licai("理财", 19);

  private String name;
  private Integer index;

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public Integer getIndex() {
    return index;
  }

  public void setIndex(Integer index) {
    this.index = index;
  }

  private TagType(String name, Integer index) {
    this.name = name;
    this.index = index;
  }

  public static String getName(Integer index) {
    for (TagType pt : TagType.values()) {
      if (pt.getIndex().equals(index)) {
        return pt.getName();
      }
    }
    return null;
  }
}
